<% include header.ejs %>
<nav id="post">
    <div>
        <a href="/" >首页</a>
        <span ><%= title %></span>
    </div>
</nav>
<div  ng-controller="PostCtrl" ng-app="postApp">
    <section class="col-xs-12" >
        <form class="form-horizontal" name="PostForm" ng-submit="PostSub(PostForm.$valid)" novalidate>
            <h3>
            <span>发布话题</span>
            <small class="text-danger hide" id="errorInfo">提交内容出现错误</small>
            </h3>
            <div class="form-group">
                <div class="col-sm-6 col-sm-offset-1">
                    <label class="control-label">选择要发布的类型：</label>
                    <select class="form-control" ng-model="formData.selectName" ng-options="ty.id as ty.name for ty in names" required></select>
                </div>
            </div>
            <!-- 名称 -->
            <div class="form-group">
                <div class="col-sm-6 col-sm-offset-1">
                    <input type="text" ng-cloak class="form-control" name="title" id="title"  ng-maxlength="10" ng-model="formData.title" placeholder="名称">
                    <label ng-cloak for="inputError" class="control-label text-danger" ng-show="PostForm.title.$invalid && !PostForm.title.$pristine"><i class="glyphicon glyphicon-exclamation-sign"></i>名称不得超过十个字</label>
                </div>
            </div>
            <!-- 产地 -->
            <div class="form-group">
                <div class="col-sm-6 col-sm-offset-1">
                    <input type="text" ng-cloak name="city" class="form-control"  ng-model="formData.city" placeholder="产地">
                </div>
            </div>
            <!-- 单价 -->
            <div class="form-group">
                <div class="col-sm-6 col-sm-offset-1">
                    <input type="text" ng-cloak name="price" class="form-control"  ng-model="formData.price" placeholder="单价">
                </div>
            </div>
            <!-- 联系电话 -->
            <div class="form-group">
                <div class="col-sm-6 col-sm-offset-1">
                    <input type="text" ng-cloak name="phone" class="form-control" ng-maxlength="11" ng-model="formData.phone" placeholder="联系电话">
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-offset-1 col-sm-6 ">
                    <button class="btn btn-success ">提交</button>
                </div>
            </div>
        </form>
    </section>
</div>
<% include footer.ejs %>